﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataBaseLayer;

namespace MySQLDB.Business
{
    public class LoginBussiness
    {
        public static bool PeerExist(device dv)
        {
            using (Db aa = Demo.DbInit())
            {
                var a3 = aa.Query<device>("select uuid from device where uuid=@uuid", new { uuid = dv.UUID });
                return a3.Count() >= 1;
            }
        }

        public static void InserOrUpdate(device dv)
        {
            using (Db aa = Demo.DbInit())
            {
                aa.Devices.InsertOrUpdate(dv);
            }
        }
    }
}
